package com.mitaotao._1_语法._3_分支._3_if判断;

import java.util.Scanner;

public class _07_判断几位数_2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入需要判断的数字：");
        int num = scanner.nextInt();
        int num2 = 0;

        if (num / 10000 > 0 && num / 10000 < 10){
            num2 = 5;
        } else if (num / 1000 > 0 && num / 1000 < 10) {
            num2 = 4;
        } else if (num / 100 > 0 && num / 100 < 10) {
            num2 = 3;
        } else if (num / 10 > 0 && num / 10 < 10) {
            num2 = 2;
        } else if (num / 1 > 0 && num / 1 < 10) {
            num2 = 1;
        }else {
            System.out.println("您输入的数字不在查询范围内");
        }
        System.out.println("您输入的数字为"+num2+"位数");
        scanner.close();
    }
}
